home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_400 / 422_03 / xasm.doc < prev   
Text File  |  1994-02-25  |  59KB  |  1,261 lines

  1.     
  2.     
  3.     
  4.     
  5.     
  6.     
  7.     
  8.     
  9.     
  10.     
  11.     
  12.     
  13.     
  14.     
  15.     
  16.     
  17.     
  18.     
  19.     
  20.     
  21.                                       XASM
  22.     
  23.                                 Cross Assemblers
  24.     
  25.                                   Users Guide
  26.     
  27.     
  28.     
  29.     
  30.     
  31.                                   Release 2.2
  32.     
  33.                                Revised 03-Jan-94
  34.     
  35.     
  36.     
  37.     
  38.     
  39.                        Copyright 1983-1994 Dave Dunfield
  40.                               All rights reserved
  41.     XASM Cross Assemblers                                            Page: 1
  42.  
  43.  
  44.     1. INTRODUCTION
  45.     
  46.           This complete XASM package contains cross assemblers  for  several
  47.        popular microprocessors, as well as a number of utility programs:
  48.     
  49.             asm00       - 6800 Assembler
  50.             asm01       - 6801/6802 Assembler
  51.             asm02       - 6502 Assembler
  52.             asm05       - 6805 Assembler
  53.             asm08       - 68HC08 Assember
  54.             asm09       - 6809 Assembler
  55.             asm11       - 68HC11 Assembler
  56.             asm16       - 68HC16 Assembler
  57.             asm51       - 8051/8052 Assembler (also 803x, 873x, 875x)
  58.             asm85       - 8085 Assembler (also 8080, Z80)
  59.             asm86       - 8086 Assembler
  60.             asm96       - 8096 Assembler
  61.             hexfmt      - HEX file manipulator
  62.             macro       - Macro pre-processor
  63.             cref        - Cross reference utility
  64.             psource     - Porting source generator
  65.             int2xasm    - Convert "Intel" style source to XASM style
  66.             xasm2int    - Convert XASM style source in "Intel" style
  67.     
  68.           The XASM "package" (software and  documentation)  is  copyrighted,
  69.        and may not be re-distributed without my written permission.  If  you
  70.        find XASM useful, please help me continue to support and  enhance  it
  71.        by ordering the complete package using the order form in the enclosed
  72.        CATALOG file.
  73.     
  74.           XASM is provided on an "as is" basis,  with  no  warranty  of  any
  75.        kind. In no event shall the author be liable for any damages  arising
  76.        from its use or distribution.
  77.     
  78.           Throughout this document, angle braces ('<>') are used to indicate
  79.        operands for which a value must  be  supplied  by  the  user.  Square
  80.        braces ('[]') are used to identify operands which are optional.
  81.     XASM Cross Assemblers                                            Page: 2
  82.  
  83.  
  84.     2. ASSEMBLERS
  85.     
  86.           All of the cross assemblers read a source file (.ASM), and produce
  87.        a code  file  (.HEX)  containing  either  MOTOROLA  or  INTEL  format
  88.        ASCII-HEX download records. A optional listing file (.LST)  may  also
  89.        be produced.
  90.     
  91.        2.1 Using the assemblers
  92.     
  93.              Any assembler is invoked by entering its name  at  the  command
  94.           prompt, in the following format:
  95.     
  96.                            ASMxx <filename> [options]
  97.     
  98.              The <filename> operand is the name of the file to be assembled,
  99.           it is assumed to have the extension ".ASM" if none is supplied.
  100.     
  101.              Unless otherwise specified, the code produced by the  assembler
  102.           is written to a file  with  the  name  '<filename>.HEX',  and  the
  103.           listing is written to a file with the name '<filename>.LST'.
  104.     
  105.           2.1.1 Command line options
  106.     
  107.                 The following options may be specified on the command  line,
  108.              following the <filename> operand:
  109.     
  110.              -C - [C]ase sensitive
  111.     
  112.                      Causes the assembler  to  make  a  distinction  between
  113.                   upper and lower case characters in symbol  names,  thereby
  114.                   allowing you to have multiple symbol  names  which  differ
  115.                   only in case. If this options is not used,  the  assembler
  116.                   will ignore such case differences,  and  assume  that  the
  117.                   symbols are the same. NOTE: When using this  options,  you
  118.                   must enter any register names in UPPER case.
  119.     
  120.              C=<filename> - Specify [C]ode file
  121.     
  122.                      This option allows you to specify the file to which the
  123.                   output code is written. If no  extension  is  supplied  as
  124.                   part of <filename>, it defaults to ".HEX".
  125.     
  126.              -F - Generate [F]ull listing
  127.     
  128.                      Causes the assembler to output a full source listing to
  129.                   the '.LST' file. By default, only lines containing  errors
  130.                   are written to the listing file.
  131.     
  132.              -I - Generate [I]ntel format HEX file
  133.     
  134.                      Causes the assembler to output the code to  the  '.HEX'
  135.                   file in INTEL hex format. By default the code  is  written
  136.                   to the file in MOTOROLA hex format.
  137.     XASM Cross Assemblers                                            Page: 3
  138.  
  139.  
  140.              L=<filename> - Specify [L]isting file
  141.     
  142.                      This option allows you to specify the file to which the
  143.                   listing is written. If no extension is supplied as part of
  144.                   <filename>, it defaults to ".LST".
  145.     
  146.              O=<value> - [O]ptimization (ASM00,01,02,05,08,09,11,16 and 96)
  147.     
  148.                      This option allows you to set a limit  to  the  maximum
  149.                   number of optimization passes  which  the  assembler  will
  150.                   perform while attempting to minimize code size and resolve
  151.                   forward  referenced  symbols.  If  a  symbol  can  not  be
  152.                   resolved within  this  many  passes,  the  assembler  will
  153.                   terminate with an error message.
  154.     
  155.                      You may specify between 0 and 127  optimization  passes
  156.                   to be run, with  0  being  a  special  case  in  which  no
  157.                   optimization  is  performed.  Without  optimization,   all
  158.                   non-specified memory references  and  offsets  default  to
  159.                   their largest form, and forward references in EQU, ORG, or
  160.                   RMB statements will not work. The code generated will  not
  161.                   be optimal, but assembly time is reduced. This feature  is
  162.                   most useful when initialy testing and debugging a program.
  163.     
  164.                      The default number of optimization passes allowed is 3.
  165.     
  166.              P=<length> - Set page length
  167.     
  168.                      This options specifies the number of lines  which  will
  169.                   be printed on each page. The default number of  lines  per
  170.                   page is 60.
  171.     
  172.              -Q - [Q]uiet mode
  173.     
  174.                      Causes  the  assembler  to  be  quiet,  inhibiting  the
  175.                   display of the progress messages.
  176.     
  177.              -S - Generate [S]ymbol table
  178.     
  179.                      Causes the assembler to sort  and  display  the  symbol
  180.                   table at the end of the  listing  file.  By  default,  the
  181.                   symbol table is not displayed.
  182.     
  183.              -T - Output to [T]erminal
  184.     
  185.                      Causes the assembler  to  output  the  listing  to  the
  186.                   terminal, (via stdout) instead of the usual '.LST' file.
  187.     
  188.         W=<width> - Set page width
  189.     
  190.                 This options control the number of  columns  which  will  be
  191.              used for the printing of  page  titles  and  the  symbol  table
  192.              listing. Default page width is 80 columns.
  193.     XASM Cross Assemblers                                            Page: 4
  194.  
  195.  
  196.        2.2 Redirecting the listing file
  197.     
  198.              When the listing file is directed to the terminal with the '-t'
  199.           option on the command line, it is displayed through  the  standard
  200.           output file, allowing it to be redirected to a  printer  etc.  via
  201.           the shell '>' redirection  operator